<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
<html>
<head>
<!-- Copyright 1997 The Open Group, All Rights Reserved -->
<title>aio_cancel</title>
</head><body bgcolor=white>
<center>
<font size=2>
The Single UNIX &reg; Specification, Version 2<br>
Copyright &copy; 1997 The Open Group

</font></center><hr size=2 noshade>
<h4><a name = "tag_000_001_104">&nbsp;</a>NAME</h4><blockquote>
aio_cancel - cancel an asynchronous I/O request
(<b>REALTIME</b>)
</blockquote><h4><a name = "tag_000_001_105">&nbsp;</a>SYNOPSIS</h4><blockquote>
<pre><code>

#include &lt;<a href="aio.h.html">aio.h</a>&gt;

int aio_cancel(int <i>fildes</i>, struct aiocb *<i>aiocbp</i>);
</code>
</pre>
</blockquote><h4><a name = "tag_000_001_106">&nbsp;</a>DESCRIPTION</h4><blockquote>
The
<i>aio_cancel()</i>
function attempts to cancel one or more asynchronous I/O requests
currently outstanding against file descriptor
<i>fildes</i>.
The
<i>aiocbp</i>
argument points to the asynchronous I/O control block
for a particular request to be canceled.
If
<i>aiocbp</i>
is NULL, then all outstanding cancelable asynchronous I/O requests
against
<i>fildes</i>
are canceled.
<p>
Normal asynchronous notification occurs for asynchronous I/O operations
that are successfully canceled.
If there are requests that cannot be canceled,
then the normal asynchronous completion process
takes place for those requests when they are completed.
<p>
For requested operations that are successfully canceled,
the associated error status is set to [ECANCELED]
and the return status is -1.
For requested operations that are not successfully canceled, the
<i>aiocbp</i>
is not modified by
<i>aio_cancel()</i>.
<p>
If
<i>aiocbp</i>
is not NULL, then if
<i>fildes</i>
does not have the same value as the file descriptor
with which the asynchronous operation was initiated,
unspecified results occur.
<p>
Which operations are cancelable is implementation-dependent.
</blockquote><h4><a name = "tag_000_001_107">&nbsp;</a>RETURN VALUE</h4><blockquote>
The
<i>aio_cancel()</i>
function returns the value
AIO_CANCELED
to the calling process if the requested operation(s) were canceled.
The value
AIO_NOTCANCELED
is returned if at least one of the requested operation(s)
cannot be canceled because it is in progress.
In this case, the state of the other operations, if any, referenced
in the call to
<i>aio_cancel()</i>
is not indicated by the return value of
<i>aio_cancel()</i>.
The application may determine the state of affairs
for these operations by using
<i><a href="aio_error.html">aio_error()</a></i>.
The value
AIO_ALLDONE
is returned if all of the operations have already completed.
Otherwise, the function returns -1 and sets
<i>errno</i>
to indicate the error.
</blockquote><h4><a name = "tag_000_001_108">&nbsp;</a>ERRORS</h4><blockquote>
The 
<i>aio_cancel()</i>
function will fail if:
<dl compact>

<dt>[EBADF]<dd>
The
<i>fildes</i>
argument is not a valid file descriptor.

<dt>[ENOSYS]<dd>
The
<i>aio_cancel()</i>
function is not supported by this implementation.

</dl>
</blockquote><h4><a name = "tag_000_001_109">&nbsp;</a>EXAMPLES</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_001_110">&nbsp;</a>APPLICATION USAGE</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_001_111">&nbsp;</a>FUTURE DIRECTIONS</h4><blockquote>
None.
</blockquote><h4><a name = "tag_000_001_112">&nbsp;</a>SEE ALSO</h4><blockquote>
<i><a href="aio_read.html">aio_read()</a></i>,
<i><a href="aio_write.html">aio_write()</a></i>.
</blockquote><h4>DERIVATION</h4><blockquote>
Derived from the POSIX Realtime Extension (1003.1b-1993/1003.1i-1995)
</blockquote><hr size=2 noshade>
<center><font size=2>
UNIX &reg; is a registered Trademark of The Open Group.<br>
Copyright &copy; 1997 The Open Group
<br> [ <a href="../index.html">Main Index</a> | <a href="../xshix.html">XSH</a> | <a href="../xcuix.html">XCU</a> | <a href="../xbdix.html">XBD</a> | <a href="../cursesix.html">XCURSES</a> | <a href="../xnsix.html">XNS</a> ]

</font></center><hr size=2 noshade>
</body></html>

